#include "BlockOutline.h"

#include "Asset/AssetManager.h"

BlockOutline::BlockOutline(Ref<CubeMesh> blockMesh)
    : m_outlinedBlockShader(AssetManager::LoadAsset<Shader>("assets/shaders/src/Outline")),
      m_blockMesh(std::move(blockMesh)) {}

void BlockOutline::Render(const glm::mat4& mvp) const {
  m_outlinedBlockShader->SetMat4("uMVP", mvp);
  m_outlinedBlockShader->SetVec4("uColor", m_outlineColor);
  m_outlinedBlockShader->Bind();
  m_blockMesh->Render(GL_LINES);
}
